batch_refund
对象允许你对已经支付的多个 charge 对象发起批量退款请求。 以下是该接口的注意事项:
charge
列表,不可以有重复的 charge id
,必须全部是已支付并且未全额退款的状态;refund_url
字段为空;属性 | 描述 |
---|---|
id string | 批量退款对象 id ,由 Ping++ 生成。 |
app string | 批量退款对应的 app 对象 ID,查看如何获取App ID。 |
object string | 值为 "batch_refund"。 |
batch_no string | 批量退款批次号,3-24位,允许字母和英文。 |
created timestamp | 批量退款创建时间,用 Unix 时间戳表示。 |
description string | 批量退款详情。 |
metadata hash | 参考元数据。 |
charges array | 需要退款的 charge 对象数组。 |
refunds list | 退款详情列表,详见 refund 退款。 |
refund_url string | 退款 URL,仅在渠道为支付宝时有值,你需要获取该地址,在浏览器中打开并且输入支付宝支付密码才能完成退款。 |
status string | 批量退款状态,目前支持 5 种状态。created :退款对象已创建,所有订单在队列待处理;pending : 处理中;succeeded : 成功; failed : 失败; partially_succeeded : 部分成功。 |
time_succeeded integer | 退款成功的 Unix 时间戳。 |
livemode boolean | 是否是生产模式。 |
退款状态 status
说明
{
"id": "1511801051441290118",
"app": "app_r1uDe9rDashboard",
"object": "batch_refund",
"batch_no": "Br20180100944122120465",
"created": 1515134483,
"description": "Testing for batch refund",
"charges": [{
"charge": "ch_fHyjLKaj5OSOKCSWj01unzzL",
"refund": "re_qXPmnTD4ezHSWjLyfP5KWorT",
"status": "succeeded",
"failure_msg": null,
"amount": 1,
"description": "Description ch_fHyjLKaj5OSOKCSWj01unzzL"
}, {
"charge": "ch_HmnDKKDmrb185mbjDOCqbjct",
"refund": "re_DGm9S4jPWHKGTyzTaHPCG090",
"status": "failed",
"failure_msg": null,
"amount": 10,
"description": "Description ch_HmnDKKDmrb185mbjDOCqbjct"
}],
"refunds": {
"object": "list",
"url": null,
"has_more": false,
"data": [{
"id": "re_qXPmnTD4ezHSWjLyfP5KWorT",
"object": "refund",
"order_no": "qXPmnTD4ezHSWjLyfP5KWHuT",
"amount": 1,
"created": 1515134486,
"succeed": true,
"status": "succeeded",
"time_succeed": 1515134486,
"description": "Description ch_fHyjLKaj5OSOKCSWj01unzzL",
"failure_code": null,
"failure_msg": null,
"metadata": {},
"charge": "ch_fHyjLKaj5OSOKCSWj01unzzL",
"charge_order_no": "46093aa0c1d5f2fe",
"transaction_no": "2018010421001004920246701437",
"extra": {}
}, {
"id": "re_DGm9S4jPWHKGTyzTaHPCG090",
"object": "refund",
"order_no": "DGm9S4jPWHKGTyzTaHPCG090",
"amount": 10,
"created": 1515134489,
"succeed": false,
"status": "failed",
"time_succeed": null,
"description": "Description ch_HmnDKKDmrb185mbjDOCqbjct",
"failure_code": null,
"failure_msg": null,
"metadata": {},
"charge": "ch_HmnDKKDmrb185mbjDOCqbjct",
"charge_order_no": "T160824050908ag",
"transaction_no": null,
"extra": {}
}]
},
"refund_url": null,
"status": "partially_succeeded",
"time_succeeded": 1515134513,
"livemode": true,
"metadata": {
"userStr": "KTs/YDg3ZFUFONZUC10SuA=="
}
}